//
// Copyright (c) 2009-2011, chunquedong
//
// This file is part of ChunMap project
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE(Version >=3)
//
// History:
//   2011-09-30  Jed Young  Creation
//

using gfx
using gfx2

using chunmapModel
using chunmapData
using chunmapRaster

**
** simple draw line
**
@Js
const class SimpleLineSym : GeometrySym
{
  const Pen pen := Pen.defVal
  const Brush brush := Color.blue

  new make(|This| f) { f(this) }

  override Void drawGeometry(Geometry geom, RenderEnv r)
  {
    if (geom isnot LineString) return
    LineString ls := geom

    g := r.g
    if (g.brush != brush) g.brush = brush
    if (g.pen != pen) g.pen = pen

    g.drawPolyline2(DrawHelper.toIntArray(ls, r))
  }
}